//
//  CustomLableTextFieldView.m
//  UI10_homework
//
//  Created by aaaaaa on 16/6/17.
//  Copyright © 2016年 dllo. All rights reserved.
//

#import "CustomLableTextFieldView.h"

@interface CustomLableTextFieldView ()<UITextFieldDelegate>



@end

@implementation CustomLableTextFieldView

/*
// Only override drawRect: if you perform custom drawing.
// An empty implementation adversely affects performance during animation.
- (void)drawRect:(CGRect)rect {
    // Drawing code
}
*/

- (void)dealloc
{
    [_lable release];
    [_textField release];
    [super dealloc];
}

- (instancetype)initWithFrame:(CGRect)frame
{
    self = [super initWithFrame:frame];
    if (self) {
        self.lable = [[UILabel alloc] initWithFrame:CGRectMake(0, 0, CGRectGetWidth(self.bounds) * 0.3, CGRectGetHeight(self.bounds))];
        
        self.textField = [[UITextField alloc] initWithFrame:CGRectMake(CGRectGetWidth(self.bounds) * 0.3, 0, CGRectGetWidth(self.bounds) * 0.7, CGRectGetHeight(self.bounds))];
        self.textField.layer.borderWidth = 1.0;
        self.textField.layer.borderColor = [UIColor lightGrayColor].CGColor;
        self.textField.layer.cornerRadius = 10;
        self.textField.delegate = self;
        self.textField.userInteractionEnabled = NO;
        
        [self addSubview:self.lable];
        [self addSubview:self.textField];
    }
    return self;
}


- (BOOL)textFieldShouldReturn:(UITextField *)textField{
    [textField resignFirstResponder];
    return YES;
}


@end
